package one.stand.controller;

import one.stand.model.CompanyCategoryModel;
import one.stand.model.ResultModel;
import one.stand.request.CompanyCategoryModelRequest;
import one.stand.service.CompanyCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yandou on 2019/6/13.
 */
@RestController
@RequestMapping("company/category")
public class CompanyCategoryController extends BaseController {

    @Autowired
    protected CompanyCategoryService companyCategoryService;

    @PostMapping("list")
    public ResultModel list(@RequestBody CompanyCategoryModelRequest request) {
        return companyCategoryService.list(request);
    }

    @PostMapping("add")
    public ResultModel add(@RequestBody CompanyCategoryModel model) {
        return companyCategoryService.add(model);
    }

    @PostMapping("delete")
    public ResultModel delete(@RequestBody CompanyCategoryModel model) {
        return companyCategoryService.delete(model);
    }
}